<?php htmlTemplate('admin_header_frame.php');?>
<div class="title">充值统计

</div>


<table width="100%" cellspacing="1" cellpadding="3" id="listTable">
  <tbody>
    	<tr>
		<td colspan="7">
		<form action="">			
		日期：<input 
			id="c_sdatetime" 
			name="c_sdatetime" 
			type="text" 
			style="width:65px;"
			value='<?php 
			if (Http::get('c_sdatetime')){
				echo Http::get('c_sdatetime');
			}
			?>' class='date demo_time'  
			onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
			>-<input 
			id="c_edatetime" 
			name="c_edatetime" 
			type="text" 
			style="width:65px;"
			value='<?php 				 
			if (Http::get('c_edatetime')){
				echo Http::get('c_edatetime');
			}
			?>' class='date demo_time'  
			onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
			>
		<input type="submit" value="搜 索" class="btn"> 
		
		</form>
		</td>
	</tr>
  
  <tr>
  	<th align="left" width="10%">日期</th>  
  	<th>充值总额(比索)</th> 
    <th>充值总数</th>
    <th>充值人数</th>
    <th>登录人数</th>
    <th>人均充值(充值总额/总登陆人数)</th>
    <th>付费率(充值总数/总登陆人数)</th>     
  </tr>

	<?php 
	$sumtotalPayMoney =0;
	$sumtotalPayTimes = 0;
	$totalPayUser = 0;
	$totalLoginuser =0;
	if ($rs){
	foreach ($rs as $k=>$v):
	$sumtotalPayMoney = $sumtotalPayMoney+ $v['totalPayMoney'];//总支付金额
	$sumtotalPayTimes = $sumtotalPayTimes+ $v['totalPayTimes'];//总支付数量
	$totalPayUser = $totalPayUser+ $v['totalPayUser'];//总支付人数
	$totalLoginuser = $totalLoginuser+$v['totalLoginuser'];
	?>
   <tr>
    <td align="left" width="10%"> <?php echo $v['dateline'];?></td>
    <td align="center">
	<?php echo $v['totalPayMoney']/100;?>
	</td>
	<td align="center">
	<?php echo $v['totalPayTimes'];?>
	</td>
	<td align="center">
	<?php echo $v['totalPayUser'];?>
	</td>
	<td align="center">
	<?php echo $v['totalLoginuser'];?>
	</td>
	<td align="center">
	<?php echo round(($v['totalPayMoney']/100)/$v['totalLoginuser'],4);?>
	</td>
	<td align="center">
	<?php echo round($v['totalPayTimes']/$v['totalLoginuser'],4);?>
	</td>      
  </tr>
  <?php endforeach;}?>
  <tr style="background: #F4FAFB;">
  <td align="left">合计</td>
	<td align="center"><? echo $sumtotalPayMoney/100;?></td>
	<td align="center"><? echo $sumtotalPayTimes;?></td>
	<td align="center"><? echo $totalPayUser;?></td>
	<td align="center"><? echo $totalLoginuser;?></td>
	<td align="center"><? if($totalPayUser) echo  round($sumtotalPayMoney/$totalLoginuser/100,4);?></td>
	<td align="center"><? if($totalPayUser) echo round($sumtotalPayTimes/$totalLoginuser,4);?></td>
</tr>
 
 
  </tbody>
</table>
<?php htmlTemplate('admin_footer_frame.php');?>